Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

url-template

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-template

This is a simple URI template implementation following the [RFC 6570 URI Template specification](http://tools.ietf.org/html/rfc6570). The implementation supports all levels defined in the specification and is extensively tested.

  • 2.0.8
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is url-template?

The url-template npm package is a utility for expanding URLs that follow the URI Template specification as per RFC 6570. This package allows developers to programmatically build URLs with variable substitutions in a template format, making it easier to handle complex URL generation scenarios.

What are url-template's main functionalities?

URL Expansion

This feature allows for the expansion of URL templates with variables. The template is defined with placeholders, and the expand method replaces these placeholders with actual values provided in an object.

var urlTemplate = require('url-template');
var template = urlTemplate.parse('/{section}/{topic}{?orderby,direction}');
var url = template.expand({ section: 'blog', topic: 'npm-packages', orderby: 'date', direction: 'asc' });
console.log(url); // Outputs: /blog/npm-packages?orderby=date&direction=asc

Other packages similar to url-template

Keywords

FAQs

Package last updated on 07 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc